<%@ page import="java.util.List" %>
<%@ page import="Entity.Room" %><%--
  Created by IntelliJ IDEA.
  User: zeal
  Date: 2020/12/20
  Time: 16:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
   <!-- new add -->
   <meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">  <!-- 以上代码告诉IE浏览器，IE8/9及以后的版本都会以最高版本IE来渲染页面。 -->  
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>计算机实验室预约系统——联系管理员</title>
	<link rel="stylesheet" href="http://localhost:8080/OpenExperimentManagementSystem/css/normalize.css">
	<link rel="stylesheet" href="http://localhost:8080/OpenExperimentManagementSystem/css/common.css">
   
   
   
   	<%-- <title>全部实验</title> --%>
   	<script src="http://libs.baidu.com/jquery/3.1.1/jquery.min.js"></script>
    <script src="../jquery/jquery-3.1.1.min.js"></script>
    <script type="text/javascript">
/*        $(function () {     //显示教室类别
           $("tr").each(function () {
               var t = $(this).find("td").eq(3)
               var s = $(this).find("select[name='room']")
               if(t.text() === "1"){
                   t.text("硬件")
               }
               else  if(t.text() === "2"){
                   t.text("软件")
			   }
           })
       }) */

    </script>
</head>
<body style="background:url(http://localhost:8080/OpenExperimentManagementSystem/images/back6.jpg);background-size:100% 100% ; background-attachment: fixed"
  style="padding:20px;">
	<header>
		<div class="logo">
		<a href="http://cs.njust.edu.cn/">
			<img src="http://localhost:8080/OpenExperimentManagementSystem/images/cslogo.png" style="width: 80px;height: 80px;margin-left: 250px;margin-top: 20px;" >
		</a>
			<h1 class="vertical-center">开放性实验辅助管理系统</h1>
		</div>
		<div class="logoff">
			<a href="#"><span><em class="username">${uname}</em>（<em class="usernum">${uid}</em>）</span></a>
			<a href="LoginServlet?op=exit" id="logout"><img src="http://localhost:8080/OpenExperimentManagementSystem/images/out.png" alt="退出登录"></a>
		</div>
	</header><!-- header结束 -->
	<div class="container" style="margin:20px auto;">
		<nav class="nav-list">
			<a href="StudentPageServlet" class="nav-item" id="nav-item1">
				<span class="iconfont">&#xe63e;</span>
				<span class="item-info">主页</span>
			</a>
			
			<a href="/servlet/AllExpServlet" class="nav-item" id="nav-item3">
				<span class="item-info">全部实验</span>
			</a>
			<a href="SelectServlet" class="nav-item" id="nav-item4">
				<span class="item-info">我的实验</span>
			</a>
			
			<a href="UserCenterServlet" class="nav-item" id="nav-item6">
				<span class="item-info">用户中心</span>
			</a>
			<a href="StudentMessageServlet" class="nav-item" id="nav-item6">
				<span class="item-info">交流平台</span>
			</a>
			<span class="triangle" style="left: 268px;"></span>
		</nav>
		<div class="content">
			
			<div class="M00" style="min-height: 400px; _height: 400px;">
			    <table width="100%"  border="0" cellspacing="1" cellpadding="0" bgcolor="#e1e1e1" class="List_T">
			        <tr>
			            <td align="center" bgcolor="#b8b8b8">
			                <strong>实验名称</strong>
			            </td>
						<td align="center" bgcolor="#b8b8b8">
						    <strong>指导老师</strong>
						</td>
						<td align="center" bgcolor="#b8b8b8">
						    <strong>实验类型</strong>
						</td>
						<td align="center" bgcolor="#b8b8b8">
						    <strong>起止时间</strong>
						</td>
						<td align="center" bgcolor="#b8b8b8">
						    <strong>预约周次</strong>
						</td>
						<td align="center" bgcolor="#b8b8b8">
						    <strong>星期</strong>
						</td>	  
						<td align="center" bgcolor="#b8b8b8">
						    <strong>时段</strong>
						</td>	  
							    
						<td align="center" bgcolor="#b8b8b8">
						    <strong>查询</strong>
						</td>	            
			        </tr>
			                
			  
				<c:forEach items="${elist}" var = "e">
					<form name="addForm" action="FindRoomServlet">
					<tr>
						<input name="eid" value="${e.id}" type="hidden">
					    <td align="center" bgcolor="#FFFFFF">
							${e.name}
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
							${e.te_name}
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
					       <c:choose>
		                    <c:when test="${e.type=='1' }">
			                	硬件
			                </c:when>
			                <c:when test="${e.type=='2' }">
			                	软件
			                </c:when>
			                </c:choose>	
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
					        ${e.begweek}周至${e.endweek}周
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
					        <select name="selweek">
							<c:forEach var="i" begin="1" end="20">
								<option value="${i}">第${i}周</option>
							</c:forEach>
							</select>
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
					        <select name="selday">
		                        <option value="1">周一</option>
		                        <option value="2">周二</option>
		                        <option value="3">周三</option>
		                        <option value="4">周四</option>
		                        <option value="5">周五</option>
                    		</select>
					    </td>
					    <td align="center" bgcolor="#FFFFFF">
					        <select name="selsection">
		                        <option value="1">第一大节</option>
		                        <option value="2">第二大节</option>
		                        <option value="3">第三大节</option>
		                        <option value="4">第四大节</option>
                    		</select>
					    </td>
					     <td align="center" bgcolor="#FFFFFF">
					    	<input type="submit" value="查询">
					    </td>
					    
					 
					</tr>
			      </form>
        	</c:forEach>              
				</table>
			</div>	
		</div>
		
		
		
	</div>
<script type="text/javascript">
        function book(which) {
            $.ajax({
                type: "GET",
                url: "FindRoomServlet",
                data: $(which).serialize(),
                success: function(result){
                    if(result=="true"){
                    	window.location.href ="selectRoom"
                    }else{
                        alert("时间选择错误，请重新选择！")
                    }
                },
                error:function (e) {
                    alert("失败")
                }
            })
        }
</script>
</body>
</html>